package library;

import library.utils.Utils;
import com.gooddies.events.ValueChangedEvent;
import com.gooddies.persistence.Properties;
import com.gooddies.swing.JpWindow;
import com.gooddies.texteditors.DefaultTextField;
import java.awt.BorderLayout;
import java.awt.HeadlessException;
import java.awt.event.WindowAdapter;
import java.awt.event.WindowEvent;
import javax.swing.JFrame;
import javax.swing.JLabel;
import library.database.Data;
import library.model.Author;

/**
 * @author Dmitry
 */
public class MainFrame extends JpWindow {

    public MainFrame() throws HeadlessException {
        Utils.setDefaultFont(new JLabel().getFont().deriveFont(15.0f));
        setDefaultCloseOperation(EXIT_ON_CLOSE);
        setTitle("Библиотека");
        setLayout(new BorderLayout());
        ByGenrePanel panel=new ByGenrePanel();
        add(panel);
        pack();
        setLocationRelativeTo(null);
        addWindowListener(new WindowAdapter() {

            @Override
            public void windowClosing(WindowEvent e) {
                Properties.get().saveProperties();
            }
        });
        setSavedPosition();
    }

    @Override
    public String getWindowName() {
        return "mainWindow";
    }

}